<%@ Page Language="C#" MasterPageFile="~/master/public-regular.master" AutoEventWireup="true"
    CodeFile="register.aspx.cs" Inherits="register" Title="Untitled Page" %>

<%@ Register Namespace="ECommerce.Library.Web" TagPrefix="ucc" %>
<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderNestedHeader" runat="Server">
    <link href="<%= SiteGlobals.BaseUrl %>javascript/general/ApplicationCommon.js" rel="stylesheet" type="text/css" />
</asp:Content>

<asp:Content ID="cntContent" ContentPlaceHolderID="cphMiddleContent" runat="Server">
    <div class="regular-pages inline registration-form">
        <ucc:ResponseMessage ID="uccResponseMessage" runat="server"></ucc:ResponseMessage>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
            DisplayMode="BulletList" ShowMessageBox="true" HeaderText="Please correct the following:"
            ShowSummary="false" CssClass="Validator" />
        <br />
        <fieldset>
            <legend>Personal Details</legend>
            <label>
                First Name:</label>
            <asp:TextBox ID="tbxPersonalFirstName" runat="server" CssClass="text"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvPersonalFirstName" runat="server" ControlToValidate="tbxPersonalFirstName"
                ErrorMessage="First Name is required" Display="None" SetFocusOnError="true" EnableClientScript="true">
            </asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator runat="server" ID="revFirstName" ControlToValidate="tbxPersonalFirstName"
                EnableClientScript="true" ErrorMessage="Incorrect Text Format" SetFocusOnError="true"
                ValidationExpression="^([a-zA-Z])+?(([- .])*?([a-zA-Z])*)*$">
            </asp:RegularExpressionValidator><br />
            <label>
                Last Name</label>
            <asp:TextBox ID="tbxPersonalLastName" runat="server" CssClass="text"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvPersonalLastName" runat="server" ControlToValidate="tbxPersonalLastName"
                ErrorMessage="Last Name is required" Display="None" SetFocusOnError="true" EnableClientScript="true">
            </asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator runat="server" ID="revPersonalLastName" ControlToValidate="tbxPersonalLastName"
                EnableClientScript="true" ErrorMessage="Incorrect Name Format" SetFocusOnError="true"
                Display="None" ValidationExpression="^([a-zA-Z])+?(([- .])*?([a-zA-Z])*)*$">
            </asp:RegularExpressionValidator><br />
            <br />
            <label>
                Telephone Number</label>
            <asp:TextBox ID="tbxContactPhoneNumber" runat="server" CssClass="text" Text=""></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbxContactPhoneNumber"
                ErrorMessage="Telephone Required" Display="None" SetFocusOnError="true" EnableClientScript="true">
            </asp:RequiredFieldValidator>
            <br />
            <label>
                Email Address</label>
            <asp:TextBox ID="tbxPersonalEmailAddress" runat="server" CssClass="text"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvPersonalEmailAddress" runat="server" ControlToValidate="tbxPersonalEmailAddress"
                ErrorMessage="Email Address is required" Display="None" SetFocusOnError="true"
                EnableClientScript="true">
            </asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator runat="server" ID="revPersonalEmailAddress" ControlToValidate="tbxPersonalEmailAddress"
                EnableClientScript="true" ErrorMessage="Incorrect Email Format" SetFocusOnError="true"
                Display="None" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
            </asp:RegularExpressionValidator><br />
            <label>
                Confirm Email</label>
            <asp:TextBox ID="tbxLoginConfirmEmail" runat="server" CssClass="text"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvLoginConfirmEmail" runat="server" ControlToValidate="tbxLoginConfirmEmail"
                ErrorMessage="Login Confirm Email Address is required" Display="None" SetFocusOnError="true"
                EnableClientScript="true">
            </asp:RequiredFieldValidator>
            <asp:CompareValidator ID="cvLoginConfirmEmail" runat="server" ErrorMessage="Confirm Email does not match"
                ControlToValidate="tbxLoginConfirmEmail" ControlToCompare="tbxPersonalEmailAddress"
                Display="None" EnableClientScript="true" Operator="Equal" Type="String" SetFocusOnError="true">
            </asp:CompareValidator><br />
            <label>
                Password</label>
            <asp:TextBox ID="tbxLoginPassword" runat="server" TextMode="password" CssClass="text"></asp:TextBox>
            <span style="font-size: x-small; font-style: italic; padding-left: 10px;">must be 6
                digits</span>
            <br />
            <asp:RequiredFieldValidator ID="rfvLoginPassword" runat="server" ControlToValidate="tbxLoginPassword"
                ErrorMessage="Login Password is required" Display="None" SetFocusOnError="true"
                EnableClientScript="true">
            </asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator runat="server" ID="revLoginPassword" ControlToValidate="tbxLoginPassword"
                EnableClientScript="true" ErrorMessage="Length should be more than 6" SetFocusOnError="true"
                ValidationExpression="^[a-zA-Z0-9]{6,50}$">
            </asp:RegularExpressionValidator><br />
            <label>
                Confirm Password</label>
            <asp:TextBox ID="tbxLoginPasswordConfirm" runat="server" TextMode="password" CssClass="text"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvLoginPasswordConfirm" runat="server" ControlToValidate="tbxLoginPasswordConfirm"
                ErrorMessage="Login Confirm Password is required" Display="None" SetFocusOnError="true"
                EnableClientScript="true">
            </asp:RequiredFieldValidator>
            <asp:CompareValidator ID="cvConfirmPassword" runat="server" ErrorMessage="Password does not match"
                ControlToValidate="tbxLoginPasswordConfirm" ControlToCompare="tbxLoginPassword"
                Display="None" EnableClientScript="true" Operator="Equal" Type="String" SetFocusOnError="true">
            </asp:CompareValidator><br />
        </fieldset>
        <fieldset>
            <legend>Security Verification </legend>
            <div class="form-right-content">
                <asp:Panel ID="pnlCaptcha" runat="server" DefaultButton="imbRegister">
                    <recaptcha:RecaptchaControl runat="server" ID="recaptcha1" Theme="red" PublicKey="6LdPowUAAAAAAB4xPXbjxPxe_6mXMEkUkBFCtqb5"
                        PrivateKey="6LdPowUAAAAAALGLe-lAcCvskHZNBeCH7UE818Ox" />
                </asp:Panel>
                <asp:Button ID="imbRegister" runat="server" OnClick="imbRegister_Click" Text="Create Account"
                    CssClass="button medium black" />
                <asp:Button ID="imbReset" runat="server" CausesValidation="false" OnClientClick="javascript:ResetFields();return false;"
                    CssClass="button medium white" Text="Reset" />
            </div>
        </fieldset>
    </div>
    <script language="javascript" type="text/javascript">
        function ResetFields() {
            $('<%= tbxPersonalFirstName.ClientID %>').val("");
            $('<%= tbxPersonalLastName.ClientID %>').val("");
            $('<%= tbxPersonalEmailAddress.ClientID %>').val("");
            $('<%= tbxContactPhoneNumber.ClientID %>').val("");
        }


        function clearTextHere(field, initialText) {
            if (field != null) {
                if (field.value == initialText) {
                    field.value = "";
                    field.style.color = 'black';
                }
            }
        }
    </script>
</asp:Content>
